Use of printer
- Android
- React native
Smartpos devices has an integrated printer and the SDK provides 2 method for using it in `SDKUrovoPrinter` class:
fun print(fileWrapper: SDKFileWrapper, callback: SDKUrovoPrinterCallback)
This method allows to print a PNG format file wrapped in the fileWrapper argument. The fileWrapper
can be an
instance of SDKFileWrapper.Asset or a SDKFileWrapper.File class.
fun print(bitmap: Bitmap, callback: SDKUrovoPrinterCallback)
This method allows to print a PNG format file represented in bitmap
argument. The bitmap is an instance of Bitmap
class.
Both method receive an instance of SDKUrovoPrinterCallback
as second argument. This is an interface with 2
callback function to be implemented:
fun onSuccess()
This function will be called in case of successfully printing.
fun onError(error: SDKPrinterError)
This function will be called in case of an error. The type of error are
listed in SDKPrinterError
class.
For both options the PNG image must be at most 384 pixels wide.
Urovo smartpos devices has an integrated printer and the SDK provides a function for using it in the `@geopagos/react-native-urovo-reader-sdk` package:
import { urovoPrint } from '@geopagos/react-native-urovo-reader-sdk'
urovoPrint('some-base64-encoded-image')